<template>
	<div class="flex flex-col">
		<h3 class="title">{{ value.title }}</h3>
		<view class="goods-list">

			<block v-for="(item, index) in value.imgList" :key="index">
				<view class="tui-item-box" hover-class="hover" :hover-start-time="150">
					<image class="tui-img" @tap.stop="handleAction(item)" :src="item.imgUrl" mode="widthFix" />
					<div class="price">{{item.price+'元'}}</div>
				</view>
			</block>
		</view>
	</div>
</template>

<script>
	export default {
		name: "m-recommend-goods",
		props: {
			value: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		data() {
			return {
				dataList: []
			};
		},
		computed: {},
		watch: {
			item(val) {
				this.$forceUpdate();
			},
		},
		created() {},
		methods: {
			handleAction(item) {
				uni.navigateTo({
					url: item.imgLink
				})
			},
		}
	}
</script>

<style scoped>
	.goods-list {
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		flex-wrap: wrap;
		box-sizing: border-box;
		margin: 20rpx 20rpx 20rpx 20rpx;
	}

	.title {
		margin: 20rpx 20rpx;
		font-size: 28rpx;
		font-weight: bold;
	}

	.tui-item-box {
		flex: 0 0 23%;
	}

	.tui-img {
		width: 100%;
		height: 100rpx;
	}

	.price {
		padding: 8rpx 0;
		text-align: center;
		font-size: 24rpx;
		color: #333333;
	}
</style>
